class Enum {
  constructor (value, description, customFields) {
    this.value = value
    this.desc = description

    if (customFields !== undefined) {
      Object.entries(customFields).forEach(entry => {
        this[entry[0]] = entry[1]
      })
    }
  }
}
export default {
  // 保养周期 DAILY，WEEKLY，MONTHLY，YEARLY
  MAINTENANCE_CYCLE: {
    NONE_CYCLE: new Enum('', '--', { color: '#5F77FD' }),
    DAY_CYCLE: new Enum('DAILY', '日循环', { color: '#5F77FD' }),
    MONTH_CYCLE: new Enum('WEEKLY', '周循环', { color: '#18D77F' }),
    QUARTER_CYCLE: new Enum('MONTHLY', '月循环', { color: '#FF8559' }),
    YEAR_CYCLE: new Enum('YEARLY', '年循环', { color: '#FF8559' })
  },
  // 保养状态
  MAINTENANCE_STATUS: {
    WAITING_LIST: new Enum(1, '待保养', { color: '#5F77FD', bgColor: 'rgb(95, 119, 253, 0.4)' }),
    WAITING_REPAIR: new Enum(2, '保养中', { color: '#2BD0F7', bgColor: 'rgb(43, 208, 247, 0.4)' }),
    REPAIRING: new Enum(3, '已保养', { color: '#999999', bgColor: 'rgb(153, 153, 153, 0.4)' }),
    DEVICE_REPAIR_FINISH: new Enum(4, '过期', { color: '#E43434', bgColor: 'rgb(228, 52, 52, 0.4)' })
  },
  // 保养类型
  MAINTENANCE_TYPE: {
    SPOT_CHECK: new Enum(1, '点检', { color: '#5F77FD' }),
    MAINTENANCE_CHECK: new Enum(2, '保养', { color: '#18D77F' })
  },
  // 计划保养时长
  PLAN_TIME_UNIT: {
    HOUR_UNIT: new Enum(1, '天'),
    DAY_UNIT: new Enum(2, '小时')
  },
  // 限制保养
  LIMIT_MAINTENANCE_UNIT: {
    NONE_UNIT: new Enum('none', '无'),
    WEEK_UNIT: new Enum('WEEKLY', '周'),
    MONTH_UNIT: new Enum('MONTHLY', '月')
  },
  // 派单时间
  ORDER_TIME: {
    TODAY_TIME: new Enum(0, '当天'),
    ONCE_TIME: new Enum(1, '提前一天'),
    TWO_TIME: new Enum(2, '提前二天'),
    THREE_TIME: new Enum(3, '提前三天')
  },
  // 周
  ALL_WEEK: {
    Monday: new Enum(1, '星期一', { day: '一' }),
    Tuesday: new Enum(2, '星期二', { day: '二' }),
    Wednesday: new Enum(3, '星期三', { day: '三' }),
    Thursday: new Enum(4, '星期四', { day: '四' }),
    Friday: new Enum(5, '星期五', { day: '五' }),
    Saturday: new Enum(6, '星期六', { day: '六' }),
    Sunday: new Enum(7, '星期天', { day: '天' })
  },
  MAINTENANCE_ORDER_STATUS: {
    Normal: new Enum(1, '正常'),
    ABNORMAL: new Enum(2, '异常')
  }
}
